<template>
  <div id="details">
    <el-radio-group size="mini" v-model="activeName" class="tabs">
      <el-radio-button @click.native="getListid(1)" label="1">河内五</el-radio-button>
      <el-radio-button @click.native="getListid(2)" label="2">澳洲五</el-radio-button>
    </el-radio-group>
    <!-- 列表 -->
    <div>
      <!-- 搜索 -->
      <el-input
        class="edge"
        style="width:180px"
        size="mini"
        placeholder="期数"
        prefix-icon="el-icon-search"
        v-model="issue"
      ></el-input>
      <!-- 时间 -->
      <el-date-picker
        class="edge"
        style="width:180px"
        size="mini"
        @change="getSTime"
        value-format="yyyy-MM-dd"
        format="yyyy-MM-dd"
        v-model="dayTime"
        type="date"
        placeholder="选择日期时间"
      ></el-date-picker>

      <!-- 期数 -->
      <!-- <el-select
        class="edge"
        style="width:180px"
        clearable
        size="mini"
        v-model="choose"
        placeholder="期数"
      >
        <el-option v-for="item in nper" :key="item.issue" :label="item.issue" :value="item.issue"></el-option>
      </el-select> -->
      <span>期数：</span>
      <el-input
      size="mini"
      style="width:180px"
        placeholder="期数"
        v-model="choose"
        >
      </el-input>

      <!-- 复选框 -->
      <el-radio @click.native="radioID(1)" class="edge" size="mini" v-model="isWin">只看中奖</el-radio>
      <span class="edge">开奖结果：98542</span>
      <!-- 确定 -->
      <el-button style="margin-left:10px" size="mini" type="primary" @click="list">确认</el-button>
       <el-button style="margin-left:10px" size="mini"  @click="assert">重置</el-button>
     
      <!-- 列表 -->
      <div>
        <el-table
          show-summary
          border
          size="mini"
          :header-cell-style="{background:'#ccc'}"
          :data="tabletime"
          style="width: 100%"
        >
          <el-table-column prop="id" label="注册编号"></el-table-column>
          <el-table-column prop="memberId" label="会员"></el-table-column>
          <el-table-column prop="memberAccount" label="号码"></el-table-column>
          <el-table-column prop="num" label="下注金额"></el-table-column>
          <el-table-column prop="finalOdds" label="赔率"></el-table-column>
          <el-table-column prop="isWin" label="中奖"></el-table-column>
          <el-table-column label="会员">
            <el-table-column prop="memberProfit.backAmount" label="回水" width="80"></el-table-column>
            <el-table-column prop="memberProfit.profit" label="盈利" width="80"></el-table-column>
          </el-table-column>
          <el-table-column label="代理">
            <el-table-column prop="agentProfit.interceptAmount" label="吃货"></el-table-column>
            <el-table-column prop="agentProfit.profit" label="盈利"></el-table-column>
          </el-table-column>
          <el-table-column label="总代理">
            <el-table-column prop="generalAgentProfit.interceptAmount" label="吃货"></el-table-column>
            <el-table-column prop="generalAgentProfit.profit" label="盈利"></el-table-column>
          </el-table-column>
          <el-table-column label="股东">
            <el-table-column prop="shareholderProfit.interceptAmount" label="吃货"></el-table-column>
            <el-table-column prop="shareholderProfit.profit" label="盈利"></el-table-column>
          </el-table-column>
          <el-table-column prop="statusName" label="状态"></el-table-column>
          <el-table-column prop="path" label="路径"></el-table-column>
          <el-table-column prop="IP" label="IP"></el-table-column>
          <el-table-column prop="createTime" label="下注时间"></el-table-column>
        </el-table>
      </div>
      <!-- 分页 -->
      <div style="text-align:right;margin-top:20px">
        <el-pagination
          size="mini"
          class="pageNumage"
          @current-change="handleCurrentChange"
          background
          layout="prev, pager, next"
          :total="total"
        ></el-pagination>
      </div>
    </div>
   
  </div>
</template> 
<script>
import { getList } from "@/api/table";
import { statuslist ,current} from "@/api/user";
import qs from "qs";
export default {
  name: "details",
  data() {
    return {
      activeName: "1",
      issue: "", //期数
      choose:"", //彩种
      dayTime: "", //日期
      pageNum: 1,
      total: 0,
      isNaN:"",
      isWin:"",//中奖
      nper:[],
      tabletime: [],//列表
      listid:"1"
    };
  },

 created(){
   this.list(this.listid);
   this.npertype()
 },
  methods: {
    // 期数
     npertype(){
       let data = qs.stringify({
         module:this.listid,
      });
      current(data).then(res => {
        console.log(res.data, "期数");
        if (res.data.code == 200) {
          this.choose = res.data.data.issue
          
        } else {
          this.$message.error(res.data.msg);
        }
       
      });
     },
    // 接口
    getListid(num){
      this.listid = num
      
    },
    list(){
      let data = qs.stringify({
        pageNum:this.pageNum,
        pageSize:10,
        module:this.listid,
        isWin:this.isNaN,
        issue:this.choose,
        day:this.dayTime
      });
      statuslist(data).then(res => {
        console.log(res.data, 888);
        if (res.data.code == 200) {
          this.tabletime = res.data.data;
          this.total = res.data.count;
        } else {
          this.$message.error(res.data.msg);
        }
       
      });
    },
    // 只看中奖
    radioID(num){
      this.isNaN = num
      console.log(this.isNaN,8799999)
    },
 
    // 时间
    getSTime(t) {
      console.log(t, 777);
    },
   
    // 取消
    assert(){
      this.isNaN = "",
      this.dayTime = ""
    },
    handleCurrentChange(val) {
      this.pageNum = val;
      this.list();
    },
   
  }
};
</script>
<style lang='less' scope>

#details {
  margin-top: 20px;
  margin-left: 20px;
}
.edge {
  margin: 10px 10px 20px 0 !important;
}
.el-table th > .cell {
  text-align: center !important;
}
.listOf {
  margin-top: 20px;
}
</style>